//搜索
function searchByKeyword(e) {
    let keyword = $(".search-main .product-name").val();
    if(!e || e == undefined){
        if(!keyword || keyword ==""){
            alert("请输入搜索内容")
            return false
        }
        window.location.href = "/search/" + keyword + "/1.html"
    }else{
        var evt = window.event || e;
        if (evt.keyCode == 13) {
            if(!keyword || keyword ==""){
                alert("请输入搜索内容")
                return false
            }
            //回车后要干的业务代码
            window.location.href = "/search/" + keyword + "/1.html"
        }
    }
}
// 搜索
$(".search-input input").keypress(function(e){
    var key = $.trim($(this).val());
    if(e.keyCode === 13) {
        window.location.href = "/search/" + keyword + "/1.html"
    }
})